import { Base } from "@/js/api/base";
import axios from "axios";

export class Channel extends Base {
    // constructor(port) {
    //     super(port);
    //     this.$axios = axios.create({
    //         baseURL: 'http://127.0.0.1:30006' + this.port,
    //         timeout: 30000,// 超时 毫秒
    //     })
    // }
    /**
     * 枚举列表
     * @param params
     * @param callBack
     */
    list(params, callBack) {
        this.get("/channel/channel/list", params, callBack)
    }
    detail(params, callBack) {
        this.get("/channel/channel/detail", params, callBack)
    }
    add(params, callBack) {
        this.post("/channel/channel/add", params, callBack)
    }
    edit(params, callBack) {
        this.post("/channel/channel/edit", params, callBack)
    }
    changeStatus(params, callBack) {
        this.post("/channel/channel/edit", params, callBack)
    }

    /**
     * 速率 设置
     * @param params
     * @param callBack
     */
    speedSet(params, callBack){
        this.post("/channel/speed_limit/set", params, callBack)
    }

    /**
     * 速率 状态变更
     * @param params  参数：id、status:3.激活、4.停用、5.删除
     * @param callBack
     */
    speedChangeStatus(params, callBack){
        this.post("/channel/speed_limit/change_status", params, callBack)
    }

    /**
     * 速率 列表
     * @param params
     * @param callBack
     */
    speedList(params, callBack){
        this.get("/channel/speed_limit/list", params, callBack)
    }
}

